package com.zhu.ssm.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zhu.ssm.entity.User;
import com.zhu.ssm.service.UserService;

@Controller
@RequestMapping("/user")
public class UserController {
	@Autowired
	private UserService userService;

	@RequestMapping(value = "/listusers", method = RequestMethod.GET)
	@ResponseBody
	public Map<String, Object> listUsers() {
		Map<String, Object> modelMap = new HashMap<>();
		User userCondition = new User();
		List<User> userList = userService.queryUserList(userCondition, 1, 99);
		modelMap.put("userList", userList);
		return modelMap;
	}

}
